<template>
  <div>
      <el-table :data="tableData" style="width:100%">
          <el-table-column label="设备名称" prop="name"></el-table-column>
          <el-table-column label="设备类型" prop="cameraType">
              <template slot-scope="scope">
                  <div>
                      {{
                          scope.row.cameraType===1 ? '枪机'
                          : scope.row.cameraType===2 ? '球机'
                          : scope.row.cameraType===3 ? '半球'
                          : scope.row.cameraType===5 ? '本地采集输入' : ''
                      }}
                  </div>
              </template>
          </el-table-column>
          <el-table-column label="设备状态" prop="stat">
              <template slot-scope="scope">
                  <div>
                      {{scope.row.stat?'在线':'离线'}}
                  </div>
              </template>
          </el-table-column>
      </el-table>
  </div>
</template>

<script>
import {getCameraList} from '../../url/api'
export default {
    data() {
        return {
            tableData:[],
            formSearch:{
                size:10,
                current:1
            }
        }
    },
    methods:{
        getList(){
            getCameraList().then(res=>{
                if(res.data.ok){
                    console.log(res.data.data);
                    this.tableData = res.data.data.units[0].channels
                }
            })
        }
    },
    mounted(){
        this.getList();
    }
}
</script>

<style>

</style>
